#!/bin/bash
set -e

# 设置apt源优先级
cat >/etc/apt/preferences.d/openkylin.pref <<EOF
Package: *
Pin: origin "factory.openkylin.top"
Pin-Priority: 1700
EOF

# 设置源地址
cat >/etc/apt/sources.list <<EOF
deb [trusted=yes] http://ppa.build.openkylin.top/mayukun/raspberrypi-kernel-5.15/openkylin yangtze main 

deb [trusted=yes] http://factory.openkylin.top/kif/archive/get/repos/embedded yangtze main

deb [trusted=yes] http://archive.build.openkylin.top/OTHER/Internal-mirror/repack5/baseok0.fix yangtze main
deb [trusted=yes] http://archive.build.openkylin.top/OTHER/openkylin01/ok0 yangtze main

deb http://archive.build.openkylin.top/openkylin/ yangtze main cross pty
deb http://archive.build.openkylin.top/openkylin/ yangtze-security main cross pty
deb http://archive.build.openkylin.top/openkylin/ yangtze-updates main cross pty
deb http://archive.build.openKylin.top/openkylin/ yangtze-proposed main cross pty
EOF

apt-get update
